<template>
  <div>
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/index/home' }">首页</el-breadcrumb-item>
    </el-breadcrumb>
    <br />
    <el-row class="margintop20">
      <el-col>
        <el-carousel :interval="4000" type="card" height="400px">
          <el-carousel-item v-for="(item,i) in banner" :key="i">
            <div class="mydiv">
              <img :src="item.imgUrl" alt />
            </div>
          </el-carousel-item>
        </el-carousel>

      </el-col>
    </el-row>
  </div>
</template>
<script>
import { gethomebanner } from "@/api";
import Calendar from "vue-calendar-component";
import { mapState, mapMutations } from "vuex";
export default {
  data() {
    return {
    
    };
  },
  components: {
    Calendar,
  },
  computed: {
    ...mapState(["banner","content"]),
  },
  methods: {
    ...mapMutations(["changebanner"]),
  },
  mounted() {
    gethomebanner().then((res) => {
      if (res.type) {
        this.changebanner(res.result);
      }
    });
  },
};
</script>

<style lang="scss">
.el-carousel__item h3 {
  color: #475669;
  font-size: 20px;
  opacity: 0.75;
  line-height: 200px;
  margin: 0;
}
.mydiv {
  width: 450px;
  height: 360px;
  img {
    width: 120%;
    height: 100%;
  }

  .cal {
    width: 300px;
    position: fixed;
    right: 5px;
    bottom: 5px;
    z-index: 1000;
  }
}
</style>
